package com.education.platform.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 订单表
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("`order`")
public class Order implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 订单号
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 家长ID
     */
    @TableField("parent_id")
    private Long parentId;

    /**
     * 教员ID
     */
    @TableField("teacher_id")
    private Long teacherId;

    /**
     * 需求ID
     */
    @TableField("demand_id")
    private Long demandId;

    /**
     * 科目
     */
    @TableField("subject")
    private String subject;

    /**
     * 年级
     */
    @TableField("grade")
    private String grade;

    /**
     * 授课方式
     */
    @TableField("teaching_type")
    private String teachingType;

    /**
     * 上课时间安排（JSON）
     */
    @TableField("schedule")
    private String schedule;

    /**
     * 总课时
     */
    @TableField("total_hours")
    private Integer totalHours;

    /**
     * 已完成课时
     */
    @TableField("completed_hours")
    private Integer completedHours;

    /**
     * 时薪
     */
    @TableField("hourly_rate")
    private BigDecimal hourlyRate;

    /**
     * 订单总金额
     */
    @TableField("total_amount")
    private BigDecimal totalAmount;

    /**
     * 已支付金额
     */
    @TableField("paid_amount")
    private BigDecimal paidAmount;

    /**
     * 平台手续费
     */
    @TableField("platform_fee")
    private BigDecimal platformFee;

    /**
     * 教员收入
     */
    @TableField("teacher_income")
    private BigDecimal teacherIncome;

    /**
     * 订单状态
     */
    @TableField("status")
    private String status;

    /**
     * 开始日期
     */
    @TableField("start_date")
    private LocalDate startDate;

    /**
     * 结束日期
     */
    @TableField("end_date")
    private LocalDate endDate;

    /**
     * 上课地址
     */
    @TableField("address")
    private String address;

    /**
     * 特殊要求
     */
    @TableField("requirements")
    private String requirements;

    /**
     * 取消原因
     */
    @TableField("cancel_reason")
    private String cancelReason;

    /**
     * 创建时间
     */
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    /**
     * 更新时间
     */
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}

